<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>后台管理中心</title>
<?php echo $this->_var['system_css']; ?>
        <?php echo $this->_var['system_js']; ?>
<script type="text/javascript">
            $(function(){
                
                $("#myform").validate({
                    rules: {
                        name: "required",
                        position:{
                            number:true
                        },
                        url:{
                            url:true
                        }
                        
                    },
                    messages: {
                        name: "权限的key不能为空",
                        position:{
                            number:'排序必须为数字'
                        },
                        url:{
                            url:'URL必须为正确的链接(例如：http://www.9393915.com)'
                        }
                    }
                });
            })
        </script>
</head>
<body>
<?php echo $this->fetch('message.html'); ?>
<div class="pad-10">
  <div class="explain-col"> <a class="add fb" href="<?php echo $this->_var['site_url']; ?>admin/privilege/list/">
    <input type="button" name="search" class="button" value="权限列表" />
    </a> </div>
  <div class="common-form">
    <form name="myform" action="<?php echo $this->_var['site_url']; ?>admin/privilege/edit/<?php echo $this->_var['data']['id']; ?>" method="post" id="myform" enctype="MULTIPART/FORM-DATA" >
      <fieldset>
        <legend>基本信息</legend>
        <table width="100%" class="table_form">
          <tr>
            <td width="120" class="red">权限key</td>
            <td><input type="text" name="name"  class="input-text" id="name" size="50" value="<?php echo $this->_var['data']['name']; ?>"/>
              </input></td>
          </tr>
          <tr>
            <td width="120">父级</td>
            <td><select name="parent_id">
                <option value="0">==请选择==</option>
                <?php if (count ( $this->_var['privilege_option'] ) > 0): ?>
                  <?php $_from = $this->_var['privilege_option']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'list');if (count($_from)):
    foreach ($_from AS $this->_var['list']):
?>
                      <option value="<?php echo $this->_var['list']['id']; ?>" <?php if ($this->_var['list']['id'] == $this->_var['data']['parent_id']): ?>selected='selected'<?php endif; ?>><?php echo __($this->_var['list']['name']); ?></option>
                  <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                <?php endif; ?>
              </select></td>
          </tr>
          <tr>
            <td width="120">模块名称(文件夹名)</td>
            <td><input type="text" name="module"  class="input-text" id="module" size="20" value="<?php echo $this->_var['data']['module']; ?>"/>
              </input></td>
          </tr>
          <tr>
            <td width="120">控制器</td>
            <td><input type="text" name="controller"  class="input-text" id="controller" size="20" value="<?php echo $this->_var['data']['controller']; ?>"/>
              </input></td>
          </tr>
          <tr>
            <td width="120"  >操作</td>
            <td><input type="text" name="action"  class="input-text" id="action" size="20" value="<?php echo $this->_var['data']['action']; ?>"/>
              </input></td>
          </tr>
          <tr>
            <td width="120">参数</td>
            <td><input type="text" name="data"  class="input-text" id="data" size="50" value="<?php echo $this->_var['data']['data']; ?>"/></td>
          </tr>
          <tr>
            <td> 是否禁用 </td>
            <td><label style="width:88px">
                <input type="radio" value="1"  name="display" <?php if ($this->_var['data']['display'] == 1): ?>checked="checked"<?php endif; ?>>
                是 </label>
              <label style="width:88px">
                <input type="radio" value="0"   name="display" <?php if ($this->_var['data']['display'] == 0): ?>checked="checked"<?php endif; ?>>
                否 </label></td>
          </tr>
          <tr>
            <td> 是否为链接 </td>
            <td><label style="width:88px">
                <input type="radio" value="1"  name="is_url" <?php if ($this->_var['data']['is_url'] == 1): ?>checked="checked"<?php endif; ?>>
                是 </label>
              <label style="width:88px">
                <input type="radio" value="0"   name="is_url" <?php if ($this->_var['data']['is_url'] == 0): ?>checked="checked"<?php endif; ?>>
                否 </label></td>
          </tr>
          <tr>
            <td width="80">链接地址</td>
            <td><input type="text" name="url"  class="input-text" id="url" size="50" value="<?php echo $this->_var['data']['url']; ?>" >
              </input></td>
          </tr>
          <tr>
            <td>排序</td>
            <td><input type="text" name="position" value="<?php echo $this->_var['data']['position']; ?>" class="input-text" size="10">
              </input></td>
          </tr>
          <tr align="center">
            <td colspan="2"><input type="submit" value="提交" name="dosubmit" class="button"></td>
          </tr>
        </table>
      </fieldset>
    </form>
  </div>
</div>
</body>
</html>